package com.iweb.day05.icecream;

/**
 * @author WuYongheng
 * @date 2021/11/2
 * @description
 */
public class IceCreamFactory {
    // 使用getTaste 方法获取类型的对象
    public Taste getTaste(String tasteType) {

        switch (tasteType) {
            case "草莓":
                Taste taste1 = new Strawberry();
                taste1.make();
                break;
            case "蓝莓":
                Taste taste2 = new Blueberry();
                taste2.make();
                break;
            case "香蕉":
                Taste taste3 = new Banana();
                taste3.make();
                break;
            default:
                System.out.println(tasteType + "口味正在计划筹备中!请谅解");
                break;
        }
        return null;
    }
}
